import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Main from '../views/Main.vue'
import Match from '../views/Match.vue'
import Strategy from '../views/Strategy.vue'
import Article from '../views/Article.vue'
import Hero from "../views/Hero.vue"
Vue.use(VueRouter)





const routes = [
  {
    path: '/',
    component: Main,
    children:[
      {path: "/",name:Home, component:Home},
      {path: "/strategy",name:Strategy, component:Strategy},
      {path: "/match",name:Match, component:Match},
      {path: "/acticle/:id",name:Article, component:Article, props:true},
    ]
  },
  {
    path: "/hero/:id",
    name: Hero,
    component: Hero,
    props: true
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
